//
//  TinyTaoViewController.m
//  MyFramework
//
//  Created by 余洋 on 2018/5/8.
//  Copyright © 2018年 余洋. All rights reserved.
//

#import "TinyTaoViewController.h"
#import "UIViewController+HUD.h"
#import "GesturesPasswordViewController.h"

@interface TinyTaoViewController ()

@end

@implementation TinyTaoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createUI];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)createUI {
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"手势密码" style:UIBarButtonItemStylePlain target:self action:@selector(jumpToGesturesPasswordView:)];
}

#pragma mark action
- (void)jumpToGesturesPasswordView:(UIButton *)sender {
    GesturesPasswordViewController *gesturesPasswordVC = [[GesturesPasswordViewController alloc] initWithNibName:@"GesturesPasswordViewController" bundle:[NSBundle mainBundle]];
    NSString *password = [[NSUserDefaults standardUserDefaults] objectForKey:GesturesPassword];
    if (password == nil) {
        gesturesPasswordVC.type = GesturesPasswordCreate;
    } else {
        gesturesPasswordVC.type = GesturesPasswordUnlock;
    }
    [self presentViewController:gesturesPasswordVC animated:YES completion:nil];
}

- (IBAction)showToastWithImage:(id)sender {
    [self lc_showToastMessageSuccess:@"带图片的toast"];
}

- (IBAction)showMessageToast:(id)sender {
    [self lc_showToastMessage:@"普通的toast"];
}

- (IBAction)showGifToast:(id)sender {
    [self lc_showToastMessageGif:@"加载中..."];
}

@end
